import 'dart:core';
import 'dart:mirrors';
import 'Foo.dart';
main() {
  Symbol lib = Symbol("foo_lib");

  Symbol clsToSearch = Symbol("Foo");

  if(checkIf_classAvailableInlibrary(lib, clsToSearch)) {
    print("class found..");
  }
}
bool checkIf_classAvailableInlibrary(Symbol libraryName, Symbol className) {
  MirrorSystem mirrorSystem = currentMirrorSystem();
  LibraryMirror libMirror = mirrorSystem.findLibrary(libraryName);
  print("Found Library");
  print("checking...class details..");
  print("No of classes found is : ${libMirror.declarations.length}");
  libMirror.declarations.forEach((key, value) => print("key:$key | value:$value"));
  print(libMirror.declarations[Symbol("Foo")]);
  if (libMirror.declarations.containsKey(className)) return true;
  return false;

}